<meta charset = "utf-8"/>
<script>
 	var str=prompt("请输入字符串：");
 	var ar=str.substring(0);
 	var array = ar.split("");
	document.write("翻转后是：<br/>");
	 for(i=array.length-1;i>=0;i--)
 	{
  	 document.write(array[i]);
 	}
</script>
